package com.yingxin.yx.framework.security.userdetails;

import com.yingxin.yx.framework.user.dto.PermissionDto;
import com.yingxin.yx.framework.user.dto.UserDto;
import com.yingxin.yx.framework.web.req.RequestInfo;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.List;

public interface DefaultUserDetailsService extends UserDetailsService {

    List<PermissionDto> permissions(String userId) throws AuthenticationException;

    void loginSuccessLog(UserDto user, RequestInfo requestInfo);

    UserDto getUserInfo(String id);

    /**
     * 记录用户登录错误
     */
    void saveLoginErrorLog(String userName, String password, String loginIp, String pcOrApp);

}
